/*VqFTX17u5c5T6CGoj9nmVY2PIEzzzdBZbk11g00zxebjTSvwqXSCN2iSlRKW9Ofk*/
/*
 * @Author: xiahui 
 * @PageInfo: 打印
 * @Date: 2019-02-13 17:35:29 
 * @Last Modified by: xiahui
 * @Last Modified time: 2019-03-19 14:03:24
 */
import { AREA, FIELDS, URL } from '../../constance';
import { ajax, print } from 'nc-lightapp-front';

export default function(props) {
	let allRows = props.editTable.getAllRows(AREA.listTableId);

	let oids = [];
	allRows.map((row) => {
		oids.push(row.values[FIELDS.pk_ct_payplan].value);
	});

	//执行权限校验
	ajax({
		url: URL.printdatapermission,
		data: oids,
		success: (res) => {
			if (res.success) {
				print(
					'pdf', //支持两类: 'html'为模板打印, 'pdf'为pdf打印
					URL.print, //后台服务url
					{
						oids: oids // 功能节点的数据主键
					}
				);
			}
		}
	});
}

/*VqFTX17u5c5T6CGoj9nmVY2PIEzzzdBZbk11g00zxebjTSvwqXSCN2iSlRKW9Ofk*/